<html>
<head>
<script type='text/javascript'>
var httpObject;
	function getHttpObject(){
		if(window.XMLHttpRequest){
			return new XMLHttpRequest();
		}
		else if(window.ActiveXObject){
			return new ActiveXObject("Microsoft.XMLHTTP");
		}
		else{
			alert("Your Browser does not support Ajax");
		}
	}
	function doWork(){
		httpObject=getHttpObject();
		if(httpObject !=null){
			 httpObject.open('GET',"inputText.php?txt="+document.getElementById('inpText').value,true);
			 httpObject.send(null);
			 httpObject.onreadystatechange=setOutput;
		}
	}
	function setOutput(){
		if(httpObject.readyState==4 && httpObject.status==200){
	document.getElementById('result').innerHTML=httpObject.responseText;
		}
	}

</script>
</head>

<body>
User Input:<input type='text' id='inpText' onkeyup='doWork()'>
<span id='result'></span>


</body>
</html>
